<template>
    <div class="member-list">
        <div class="member-list-card">
            <div class="member-list-head">
                <Row :gutter="5" style="margin-bottom: 10px">
                    <!--<Col span="4">-->
                        <!--<DatePicker  clearable v-model="searchData.timeStartEnd" style="width: 100%" type="daterange" placeholder="时间筛选"></DatePicker>-->
                    <!--</Col>-->
                    <!--<Col span="4">-->
                        <!--<Input clearable v-model="searchData.loginName" placeholder="登录名" type="text"></Input>-->
                    <!--</Col>-->
                    <Col span="4">
                        <Input clearable v-model="searchData.username" placeholder="用户名" type="text"></Input>
                    </Col>

                    <Col span="4">
                        <Input clearable v-model="searchData.phone" placeholder="用户电话" type="text"></Input>
                    </Col>


                <!--</Row>-->
                <!--<Row :gutter="5">-->
                    <!--<Col span="4">-->
                        <!--<Select clearable v-model="searchData.userType" placeholder="是否为店铺">-->
                            <!--<Option :value="1">是</Option>-->
                            <!--<Option :value="0">否</Option>-->
                        <!--</Select>-->
                    <!--</Col>-->
                    <!--<Col span="4">-->
                        <!--<Select clearable v-model="searchData.svip" placeholder="是否是金牌代理">-->
                            <!--<Option :value="1">是</Option>-->
                            <!--<Option :value="0">否</Option>-->
                        <!--</Select>-->
                    <!--</Col>-->
                    <!--<Col span="4">-->
                        <!--<Select clearable v-model="searchData.is_daili" placeholder="是否是为区代">-->
                            <!--<Option :value="1">是</Option>-->
                            <!--<Option :value="0">否</Option>-->
                        <!--</Select>-->
                    <!--</Col>-->
                    <Col span="30">
                        <ButtonGroup class="subSearch">
                            <!--<Button @click="$router.push({name:'member-add-nocache'})" type="primary" icon="plus-round">新增</Button>-->
                            <Button :loading="search_loading" @click="searchGetList" type="primary"><Icon type="ios-pulse-strong"></Icon> 筛 选</Button>
                        </ButtonGroup>
                    </Col>
                </Row>
            </div>
            <i-table height="645" stripe :columns="columns" :data="data"></i-table>
            <div style="padding: 15px;">
                <Page @on-page-size-change="changeTiao" @on-change="changePage" :current="index" :total="total" show-elevator show-sizer :placement="'top'" :page-size="page_con" :page-size-opts="[10, 15, 20, 30, 40, 50]"></Page>
            </div>
        </div>
        <!--删除-->
        <!--<Modal v-model="modal1" width="360">-->
            <!--<p slot="header" style="color:#f60;text-align:center">-->
                <!--<Icon type="information-circled"></Icon>-->
                <!--<span>删除确认</span>-->
            <!--</p>-->
            <!--<div style="text-align:center">-->
                <!--<p>是否继续删除？</p>-->
            <!--</div>-->
            <!--<div slot="footer">-->
                <!--<Button type="error" size="large" long :loading="modal_loading" @click="del">删除</Button>-->
            <!--</div>-->
        <!--</Modal>-->
        <Modal v-model="moda11" width="360">
            <p slot="header" style="text-align:center">
                <a>线下项目收款提交</a>
            </p>
            <Form>
                <FormItem label="用户名" prop="username">
                    <Input v-model="formValidate.username" placeholder="请输入用户名"></Input>
                </FormItem>
                <FormItem label="电话" prop="phone">
                    <Input v-model="formValidate.phone" placeholder="手机号"></Input>
                </FormItem>
                <FormItem label="金额" prop="money">
                    <Input v-model="formValidate.money" placeholder="请输入金额"></Input>
                </FormItem>
                <FormItem label="备注" prop="beizhu">
                    <Input v-model="formValidate.beizhu" placeholder="请输入备注"></Input>
                </FormItem>
            </Form>


            <div slot="footer">
                <Button type="primary" size="large" long :loading="modal_loading" @click="submit">提交</Button>
            </div>
        </Modal>
    </div>
</template>
<script>
    export default {
        name:"offlinemoney-list",
        data(){
            return{
                columns:[
                    {
                        title: '序号',
                        type: 'index',
                        width: 60,
                        align:"center",
                    },
                    // {
                    //     title: '登录名',
                    //     key: 'loginname',
                    //     align:"center",
                    // },
                    {
                        title: '用户名',
                        key: 'username',
                        align:"center",
                    },
                    {
                        title: '手机号',
                        key: 'phone',
                        align:"center",
                    },
                    // {
                    //     title: '可提余额',
                    //     key: 'money_shangcheng',
                    //     align:"center",
                    //     render:(h,params)=>{
                    //         return `￥ ${params.row.money_shangcheng}`
                    //     }
                    // },
                    // {
                    //     title: '创建时间',
                    //     key: 'add_time',
                    //     align:"center",
                    //     render:(h,params)=>{
                    //         return this.timeFormat(params.row.add_time)
                    //     }
                    // },
                    // {
                    //     title: '使用时间',
                    //     key: 'use_time',
                    //     align:"center",
                    //     render:(h,params)=>{
                    //         return this.timeFormat(params.row.use_time)
                    //     }
                    // },

                    // {
                    //     title: '状态',
                    //     key: 'status',
                    //     align:"center",
                    //     render:(h,params)=>{
                    //         if (params.row.status==1){
                    //             return  '已使用'
                    //         }
                    //         else {
                    //             return  '未使用'
                    //         }
                    //     }
                    // },
                    {
                        title: '金额',
                        key: 'money',
                        align:"center",
                    },
                    {
                        title: '备注',
                        key: 'beizhu',
                        align:"center",
                    },
                    // {
                    //     title: '操作',
                    //     key: 'action',
                    //     align: 'center',
                    //     width: 250,
                    //     render: (h, params) => {
                    //         return h('ButtonGroup', [
                    //             h("Button",{
                    //                 props:{
                    //                     type:"primary"
                    //                 },
                    //                 on:{
                    //                     click:()=>{
                    //                         this.uid = params.row.uid;
                    //                         this.moda11 = true
                    //                     }
                    //                 }
                    //             },"修改"),
                    //         ]);
                    //     }
                    // },
                    // {
                    //     title: '是否启用',
                    //     key: 'userstatus',
                    //     width:100,
                    //     align:"center",
                    //     render:(h,params)=>{
                    //         if(params.row.userstatus==1){
                    //             return h("Icon",
                    //                 {
                    //                     props:{
                    //                         type:"checkmark-round",
                    //                         color:"green",
                    //                     }
                    //                 }
                    //             )
                    //         }else{
                    //             return h("Icon",
                    //                 {
                    //                     props:{
                    //                         type:"close-round",
                    //                         color:"red",
                    //                     }
                    //                 }
                    //             )
                    //         }
                    //     }
                    // },

                ],
                data:[],
                total:0,
                index:1,
                page_con:15,
                searchData:{

                    username:"",
                    phone:"",//
                    old_username:"",
                    num:"",
                    userStatus:"",
                    svip:"",
                    is_daili:"",
                    uid:'',
                },
                username:"",
                search_loading:false,
                moda11:false,
                id:"",
                type:1,
                formValidate:{
                    level:"",
                    status:"",
                    money:'',
                    change_money_type:'1',
                    inc_type:'1',
                    num:'',
                    remark:''
                },
                ruleValidate:{
                    level: [{ required: true, message: '请选择激活状态', trigger: 'change' }],
                    ststus: [{ required: true, message: '请选择会员等级', trigger: 'change' }],
                    money: [{ required: false, message: '请输入资金金额', trigger: 'blur' }],
                    change_money_type: [{ required: true, message: '请选择资金种类', trigger: 'change' }],
                    inc_type: [{ required: true, message: '请选择增加/减少', trigger: 'change' }],
                    num: [{ required: true, message: '请输入资金金额', trigger: 'blur' }],
                    remark: [{ required: false, message: '请输入备注', trigger: 'blur' }],
                },

            }
        },
        activated(){
            this.getOrderList()
        },
        mounted(){
        },
        methods:{
            getOrderList(){
                this.getJsonData("User/getUserProject",{
                    username:this.searchData.username,
                    phone:this.searchData.phone,
                },true)
                    .then((res)=>{
                        this.data=res.data
                        this.total=parseInt(res.count)
                        this.search_loading=false
                    })
                    .catch((res)=>{
                        this.search_loading=false
                    })
            },
            changePage(n){
                this.index=n
                this.getOrderList()
            },
            changeTiao(num){
                this.page_con=num
                this.index=1
                this.getOrderList()
            },
            searchGetList(){
                this.search_loading=true
                this.index=1
                this.getOrderList()
            },
            submit(){

            },
            //删除
            // del(){
            //     this.modal_loading = true;
            //     this.getJsonData("Users/deleteUsers",{userId:this.id},true)
            //         .then((res)=>{
            //             this.getOrderList()
            //             this.modal_loading = false;
            //             this.modal1 = false;
            //             this.$Message.success('删除成功');
            //         }).catch((res)=>{
            //         this.modal_loading = false;
            //         this.modal1 = false;
            //     })
            // },


            reset(){
                this.$refs.formValidateAgent.resetFields();
            }
        },
    }
</script>
<style lang="less">
    @import "offlinemoney-list";
</style>